package cn.yangliu.comm.entity;

import cn.yangliu.comm.CommConst;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 作者 杨柳
 * 创建时间 2017-08-26 21:27
 */

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public abstract class BaseBean extends BaseObject{

    private static final long serialVersionUID = 3137145308653310100L;

    @TableId(type = IdType.AUTO)
    @TableField
    private Long id;

    @JSONField(format = CommConst.DATETIME_PATTERN)
    @DateTimeFormat(pattern = CommConst.DATETIME_PATTERN)
    @TableField(update = "now()")
    private LocalDateTime updateTime;



    @JSONField(format = CommConst.DATETIME_PATTERN)
    @DateTimeFormat(pattern = CommConst.DATETIME_PATTERN)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    private String remark;


}
